home *** CD-ROM | disk | FTP | other *** search
Makefile | 1995-06-20 | 3.5 KB | 160 lines |
- # makefile for man
- #
- # date: Sat Jan 19 04:08:46 1991
- # version: 2.0
- #
- #
-
- # set this to executable file extension, if necessary (eg, .exe for MSDOS,
- # .ttp for atari)
- #
- EXE =
-
- SECT = 1
- TARGET = man$(EXE)
- MANPAGE = man.$(SECT)
- MANSRC = man.man
- HEADERS =
- SRCS = $(HEADERS) man.c
- OTHERS = readme makefile $(MANSRC)
- DISTFILES = $(OTHERS) $(SRCS)
- OBJS = man.o
-
-
- # set CC to the command needed to compile a file (to a .o file).
- # set LD to the command needed to link .o files.
- #
- #CC = gcc -v -z -Wall -Ic:/u/gcc/include
- #LD = gcc -v -z -Wall -Lc:/u/gcc/lib -nostdlib c:/u/gcc/lib/crt0.o
- CC = cc -Aa
- LD = cc -Aa
-
-
- # defines based on what you have:
- # -DHAS_CAT yes, i have cat$(EXE)
- # -DHAS_UL yes, i have ul$(EXE)
- # -DHAS_WHATIS yes, i have whatis$(EXE)
- # -DHAS_APROPOS yes, i have apropos$(EXE)
- # -DLONG_SECT use longer list for things like "local"
- # -DUSE_INDEX if you need index/rindex instead of strchr/strrchr
- # -Datarist for Atari ST
- # -DMSDOS for PC
- # -Dunix for unix systems (or unix-like)
- #
- DEFS = -DHAS_CAT -DHAS_UL -DHAS_WHATIS -DHAS_APROPOS -DLONG_SECT
-
-
- # set ARCH for things like -mshort.
- # set OPT potentially to -O.
- # set libs to list of libraries needed in link (eg, -lc).
- #
- ARCH =
- OPT =
- CFLAGS = $(ARCH) $(OPT) $(DEFS)
- LDFLAGS = $(ARCH)
- LIBS =
-
- # set BINDIR to the place where you want the executable installed.
- # set MANDIR to the place where man's manpage will be installed (the
- # directory must exist; consider doing "make dirs" before "make install")
- # include a trailing / (or \) for both BINDIR and MANDIR.
- #
- #SLASH =\\
- #BINDIR = c:\usr\bin
- #MANTOP = c:\usr\man
- #MANDIR = $(MANTOP)$(SLASH)man$(SECT)
- #CATDIR = $(MANTOP)$(SLASH)cat$(SECT)
- SLASH =/
- BINDIR = /mnt/rosenkra/test/bin
- MANTOP = /mnt/rosenkra/test/man
- MANDIR = $(MANTOP)$(SLASH)man$(SECT)
- CATDIR = $(MANTOP)$(SLASH)cat$(SECT)
-
- # install commands
- #
- INST_BIN = cp -p
- INST_MAN = cp -p
-
- RM = rm -f
-
-
- # directions...
- #
- directions:
- @echo type "make all" to built $(TARGET)
- @echo type "make dirs" to create $(MANDIR) directories
- @echo type "make install" to build/install $(TARGET)
- @echo type "make clean" to remove objects
- @echo type "make clobber" to remove objects and $(TARGET)
- @echo these should be done in this order
-
-
- # main target...
- #
- all: $(TARGET)
-
- $(TARGET): $(OBJS)
- $(LD) $(LDFLAGS) -o $(TARGET) $(OBJS) $(LIBS)
-
-
-
- # manpage (use built-in .man.cat rule)...
- #
- manpage: $(MANPAGE)
-
- $(MANPAGE): $(MANSRC)
- nroff -man $(MANSRC)|ul -t dumb|cat -s >$(MANPAGE)
-
-
-
-
- # create directories
- #
- dirs: install_dirs
-
- install_dirs:
- mkdir $(MANTOP)
- mkdir $(MANTOP)$(SLASH)cat0 $(MANTOP)$(SLASH)man0
- mkdir $(MANTOP)$(SLASH)cat1 $(MANTOP)$(SLASH)man1
- mkdir $(MANTOP)$(SLASH)cat2 $(MANTOP)$(SLASH)man2
- mkdir $(MANTOP)$(SLASH)cat3 $(MANTOP)$(SLASH)man3
- mkdir $(MANTOP)$(SLASH)cat4 $(MANTOP)$(SLASH)man4
- mkdir $(MANTOP)$(SLASH)cat5 $(MANTOP)$(SLASH)man5
- mkdir $(MANTOP)$(SLASH)cat6 $(MANTOP)$(SLASH)man6
- mkdir $(MANTOP)$(SLASH)cat7 $(MANTOP)$(SLASH)man7
- mkdir $(MANTOP)$(SLASH)cat8 $(MANTOP)$(SLASH)man8
- mkdir $(MANTOP)$(SLASH)cat9 $(MANTOP)$(SLASH)man9
- touch install_dirs
-
-
- # to install it...
- #
- install: install_dirs install_bin install_man
-
- install_bin: $(TARGET)
- $(INST_BIN) $(TARGET) $(BINDIR)$(SLASH)$(TARGET)
- touch install_bin
-
- install_man: $(MANPAGE)
- $(INST_MAN) $(MANSRC) $(MANDIR)$(SLASH)$(MANPAGE)
- $(INST_MAN) $(MANPAGE) $(CATDIR)$(SLASH)$(MANPAGE)
- touch install_man
-
-
-
- # others...
- #
- clean:
- $(RM) core $(OBJS) errs
-
- clobber: clean
- $(RM) $(TARGET)
-
-
-
-
- # dependencies...
- #
- man.o: man.c
-
-